# coding: utf-8

from wtforms import StringField, TextAreaField, SubmitField
from wtforms.validators import DataRequired, Optional

from ..forms import WphForm


class SMSTemplateForm(WphForm):
    """
    新建/编辑短信模板表单
    """

    name = StringField('模板名称', validators=[DataRequired()])
    code = StringField('模板编码', validators=[DataRequired()])
    content = TextAreaField('模板内容', validators=[DataRequired()], render_kw={'rows': 15})
    params = StringField('模板包含参数，空格隔开', validators=[Optional()])

    submit = SubmitField('保存')


class SearchSMSLogForm(WphForm):
    """
    搜索短信发送记录表单
    """

    mobile = StringField('电话号码', validators=[Optional()])

    submit = SubmitField('查询')
